package com.example.shaidemo;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class ChaChengshiActivity extends AppCompatActivity {
    private List<ChaQiye> salary_list=new ArrayList<>();
    ChaQiyeAdapter chaQiyeAdapter;
    ListView listView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cha_chengshi);
        toolBar();

        listView=findViewById(R.id.chaqiye_list);
        salary_list.add(0,new ChaQiye(1,"阿里巴巴","1860","32867","杭州"));
        salary_list.add(1,new ChaQiye(2,"网易（杭州）网络有限公司","1662","28081","杭州"));
        salary_list.add(2,new ChaQiye(3,"蚂蚁金服（杭州）网络技术有限公司","1621","35491","杭州"));
        salary_list.add(3,new ChaQiye(4,"支付宝（杭州）信息技术有限公司","1589","34976","杭州"));

        salary_list.add(4,new ChaQiye(5,"阿里巴巴（中国）软件有限公司","452","33122","杭州"));
        salary_list.add(5,new ChaQiye(6,"阿里巴巴诚信通","1500","33750","杭州"));
        salary_list.add(6,new ChaQiye(7,"杭州涂鸦信息技术有限公司","284","27629","杭州"));
        salary_list.add(7,new ChaQiye(8,"杭州有赞科技有限公司","226","26873","杭州"));




        chaQiyeAdapter = new ChaQiyeAdapter(this, R.layout.list_item_cha_qiye, salary_list);
        listView.setAdapter(chaQiyeAdapter);
    }
    public void toolBar(){
        boolean isImmersive = false;


        final TitleBar titleBar = (TitleBar) findViewById(R.id.title_bar);
        titleBar.setBackgroundColor(getResources().getColor(R.color.colorWhite));
        titleBar.setLeftImageResource(R.drawable.ic_left_orange_24dp);
        titleBar.setTitle("查城市");
        titleBar.setLeftText("成都");
        titleBar.setLeftTextSize(18);
        titleBar.setLeftTextColor(getResources().getColor(R.color.colorLightOrange));
        titleBar.setLeftClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                finish();
            }
        });

        titleBar.setTitleColor(Color.BLACK);

        //沉浸式
        titleBar.setImmersive(isImmersive);
    }
}